// pages/customer/customer.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        active:1,
        scrollHeight:0,
        option1: [
            { text: '默认(未联系)', value: '0' },
            { text: 'A级(有明确意向)', value: '1' },
            { text: 'B级(可能有意向)', value: '2' },
            { text: 'C级(明确拒绝)', value: '3' },
            { text: 'D级(用户忙)', value: '4' },
            { text: 'E级(拨打失败)', value: '5' },
            { text: 'G级(客户报价)', value: '6' },
            { text: 'H级(已签约客户)', value: '7' },
            { text: 'I级(已回款客户)', value: '8' },
          ],     
          option2: [
            { text: '近三天', value: '0' },
            { text: '近一周', value: '1' },
            { text: '近半个月', value: '2' },
            { text: '近一个月', value: '3' },
            { text: '近三个月', value: '4' },
            { text: '近半年', value: '5' },
            { text: '全部', value: '6' },
          ],
          option3: [
            { text: '网络拜访', value: '0' },
            { text: '电话拜访', value: '1' },
            { text: '短信拜访', value: '2' },
            { text: '当面拜访', value: '3' },
            { text: '其他', value: '4' },
          ],
          option4: [
            { text: '近三天', value: '0' },
            { text: '近一周', value: '1' },
            { text: '近半个月', value: '2' },
            { text: '近一个月', value: '3' },
            { text: '近三个月', value: '4' },
            { text: '近半年', value: '5' },
            { text: '全部', value: '6' },
          ],
          value1: 0,
          value2: '0',
          value3: '0',
          value4: '0',
          customerObj:[
              {
                  id:1,
                  name:'李**',
                  phone:'136*******7',
                  contact:'未联系',
                  daoqi:'30',
                  time:'2023-10-12 10:30',
                  region:'福州',
                  carPlate:'闽A 2***6',
                  carModel:'奥迪 A6L 2.0T 豪华运动版',
                  quotation:'已报价'
              },{
                  id:2,
                name:'陈**',
                phone:'136*******7',
                contact:'已联系',
                daoqi:'30',
                time:'2023-10-12 10:30',
                region:'福州',
                carPlate:'闽A 2***6',
                carModel:'奥迪 A6L 2.0T 豪华运动版',
                quotation:'未报价',
                progressTime:'2023-10-12 10:30',
                progressUser:'王小姐',
                progressContent:'明天和家人过去谈保险'
            },{
                  id:3,
                name:'陈**',
                phone:'136*******7',
                contact:'已联系',
                daoqi:'30',
                time:'2023-10-12 10:30',
                region:'福州',
                carPlate:'闽A 2***6',
                carModel:'奥迪 A6L 2.0T 豪华运动版',
                quotation:'未报价',
                progressTime:'2023-10-12 10:30',
                progressUser:'王小姐',
                progressContent:'明天和家人过去谈保险'
            },
          ],
          genjinhuifangObj:[
            {
                id:1,
                name:'李**',
                phone:'136*******7',
                grade:'H级(已签约客户)',
                go:'未到店',
                time:'2023-10-12 10:30',
                region:'福州',
                intendedModel:'奥迪 A6L 2.0T 豪华运动版',
                buyCarBudget:'12.38 - 15.40万'
            },{
                id:2,
                name:'李**',
                phone:'136*******7',
                grade:'H级(未签约客户)',
                go:'有到店',
                time:'2023-10-12 10:30',
                region:'福州',
                intendedModel:'奥迪 A6L 2.0T 豪华运动版',
                buyCarBudget:'12.38 - 15.40万'
            },
        ],
        chengdanObj:[
          {
              id:1,
              name:'李**',
              phone:'136*******7',
              grade:'H级(已签约客户)',
              deal:'成交',
              time:'2023-10-12 10:30',
              region:'福州',
              intendedModel:'奥迪 A6L 2.0T 豪华运动版',
              buyCarBudget:'12.38 - 15.40万'
          },{
              id:2,
              name:'李**',
              phone:'136*******7',
              grade:'H级(未签约客户)',
              deal:'未成交',
              time:'2023-10-12 10:30',
              region:'福州',
              intendedModel:'奥迪 A6L 2.0T 豪华运动版',
              buyCarBudget:'12.38 - 15.40万',
              content:'明天和家人过去谈保险'
          },
      ]
    },

    onClick(e) {
        // console.log(e.detail.title);
        this.setData({active:e.detail.title === '跟进回访' ? 2 :
        e.detail.title === '成单客户' ?  3  :  e.detail.title === '客户池' ?  4 : 1
    })
      },
   
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        this.getTabBar().init();
        let query = wx.createSelectorQuery();
        query.select('.header-box').boundingClientRect();
        query.selectViewport().scrollOffset();
        query.exec(res=>{

        console.log(res,'res');
        this.setData({
            scrollHeight:`calc(100vh - ${res[0].height}px - 84px)`
        })
        })
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})